package day5;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileRead {
    public static void main(String[] args) {
        FileInputStream fin = null;
        try {
            fin = new FileInputStream
                    ("F:\\java76\\yangshuo\\FileTest5.java");
            int ch = 0;
            while ((ch = fin.read()) != -1) {
                System.out.println((char) ch);
                System.out.println(String.valueOf((byte) ch));
            }
//            int ch1 = fin.read();
//            int ch2 = fin.read();
//            int ch3 = fin.read();
//            System.out.println((char)ch1+","+(char)ch2+","+(char)ch3);

        } catch (java.io.IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (fin != null)
                    fin.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    }
}
